package com.fankui.serviceorder.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * ClassName ConstantPropertiesUtils
 * Description TODO
 * Date 2023/11/23 18:27
 *
 * @Author 范奎
 * @Since JDK 11
 */
@Component
public class ConstantPropertiesUtils implements InitializingBean {

    @Value("${wxpay.file.appid}")
    private String appId;

    @Value("${wxpay.file.mch_id}")
    private String mchId;

    @Value("${wxpay.file.spbill_create_ip}")
    private String spbillCreateIp;

    @Value("${wxpay.file.notify_url}")
    private String notifyUrl;

    @Value("${wxpay.file.trade_type}")
    private String tradeType;

    @Value("${wxpay.file.key}")
    private String key;

    public static String APP_ID;
    public static String MCH_ID;
    public static String SPBILL_CREATE_IP;
    public static String NOTIFY_URL;
    public static String TRADE_TYPE;
    public static String KEY;

    @Override
    public void afterPropertiesSet() {
        APP_ID = appId;
        MCH_ID = mchId;
        SPBILL_CREATE_IP = spbillCreateIp;
        NOTIFY_URL = notifyUrl;
        TRADE_TYPE = tradeType;
        KEY = key;
    }
}
